{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import time, json\n",
    "import pandas as pd\n",
    "from pyecharts.charts import Map\n",
    "import pyecharts.options as opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>累计确诊</th>\n",
       "      <th>累计死亡</th>\n",
       "      <th>累计治愈</th>\n",
       "      <th>新增确诊</th>\n",
       "      <th>新增治愈</th>\n",
       "      <th>新增死亡</th>\n",
       "      <th>日期</th>\n",
       "      <th>省份</th>\n",
       "      <th>国家</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>102</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>11.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>01/28</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>111</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>01/29</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>132</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>21.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>01/30</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>156</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>01/31</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>183</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>27.0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>02/01</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>212</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>29.0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>02/02</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>228</td>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>16.0</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>02/03</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>253</td>\n",
       "      <td>1</td>\n",
       "      <td>24</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>02/04</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>274</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "      <td>21.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>02/05</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>297</td>\n",
       "      <td>1</td>\n",
       "      <td>33</td>\n",
       "      <td>23.0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>02/06</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>315</td>\n",
       "      <td>2</td>\n",
       "      <td>34</td>\n",
       "      <td>18.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>02/07</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>326</td>\n",
       "      <td>2</td>\n",
       "      <td>37</td>\n",
       "      <td>11.0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>02/08</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>337</td>\n",
       "      <td>2</td>\n",
       "      <td>44</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>02/09</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>342</td>\n",
       "      <td>3</td>\n",
       "      <td>48</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>02/10</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>352</td>\n",
       "      <td>3</td>\n",
       "      <td>56</td>\n",
       "      <td>10.0</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>02/11</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>366</td>\n",
       "      <td>3</td>\n",
       "      <td>68</td>\n",
       "      <td>14.0</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>02/12</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>366</td>\n",
       "      <td>3</td>\n",
       "      <td>68</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>02/13</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>372</td>\n",
       "      <td>3</td>\n",
       "      <td>79</td>\n",
       "      <td>6.0</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>02/14</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>380</td>\n",
       "      <td>4</td>\n",
       "      <td>105</td>\n",
       "      <td>5.0</td>\n",
       "      <td>26</td>\n",
       "      <td>1</td>\n",
       "      <td>02/15</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>381</td>\n",
       "      <td>4</td>\n",
       "      <td>114</td>\n",
       "      <td>1.0</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>02/16</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>387</td>\n",
       "      <td>4</td>\n",
       "      <td>122</td>\n",
       "      <td>6.0</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>02/17</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>393</td>\n",
       "      <td>4</td>\n",
       "      <td>145</td>\n",
       "      <td>6.0</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>02/18</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>395</td>\n",
       "      <td>4</td>\n",
       "      <td>153</td>\n",
       "      <td>2.0</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>02/19</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>396</td>\n",
       "      <td>4</td>\n",
       "      <td>169</td>\n",
       "      <td>1.0</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>02/20</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>399</td>\n",
       "      <td>4</td>\n",
       "      <td>178</td>\n",
       "      <td>3.0</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>02/21</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>399</td>\n",
       "      <td>4</td>\n",
       "      <td>189</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>02/22</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>399</td>\n",
       "      <td>4</td>\n",
       "      <td>198</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>02/23</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>400</td>\n",
       "      <td>4</td>\n",
       "      <td>215</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>02/24</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>400</td>\n",
       "      <td>4</td>\n",
       "      <td>235</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20</td>\n",
       "      <td>0</td>\n",
       "      <td>02/25</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>410</td>\n",
       "      <td>5</td>\n",
       "      <td>248</td>\n",
       "      <td>10.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>02/26</td>\n",
       "      <td>北京</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6614</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/08</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6615</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/09</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6616</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/10</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6617</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/11</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6618</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/12</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6619</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/13</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6620</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/14</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6621</th>\n",
       "      <td>76</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/15</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6622</th>\n",
       "      <td>77</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/16</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6623</th>\n",
       "      <td>93</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/17</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6624</th>\n",
       "      <td>106</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/18</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6625</th>\n",
       "      <td>123</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/19</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6626</th>\n",
       "      <td>131</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/20</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6627</th>\n",
       "      <td>140</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/21</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6628</th>\n",
       "      <td>158</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>18.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/22</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6629</th>\n",
       "      <td>171</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/23</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6630</th>\n",
       "      <td>191</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/24</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6631</th>\n",
       "      <td>213</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>22.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/25</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6632</th>\n",
       "      <td>254</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>41.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/26</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6633</th>\n",
       "      <td>311</td>\n",
       "      <td>3</td>\n",
       "      <td>73</td>\n",
       "      <td>57.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>07/27</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6634</th>\n",
       "      <td>400</td>\n",
       "      <td>3</td>\n",
       "      <td>75</td>\n",
       "      <td>89.0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>07/28</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6635</th>\n",
       "      <td>496</td>\n",
       "      <td>3</td>\n",
       "      <td>79</td>\n",
       "      <td>96.0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>07/29</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6636</th>\n",
       "      <td>608</td>\n",
       "      <td>3</td>\n",
       "      <td>82</td>\n",
       "      <td>112.0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>07/30</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6637</th>\n",
       "      <td>639</td>\n",
       "      <td>3</td>\n",
       "      <td>89</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>07/31</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6638</th>\n",
       "      <td>668</td>\n",
       "      <td>3</td>\n",
       "      <td>96</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>08/01</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6639</th>\n",
       "      <td>696</td>\n",
       "      <td>3</td>\n",
       "      <td>103</td>\n",
       "      <td>28.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>08/02</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6640</th>\n",
       "      <td>724</td>\n",
       "      <td>3</td>\n",
       "      <td>115</td>\n",
       "      <td>28.0</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>08/03</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6641</th>\n",
       "      <td>746</td>\n",
       "      <td>3</td>\n",
       "      <td>125</td>\n",
       "      <td>22.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>08/04</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6642</th>\n",
       "      <td>773</td>\n",
       "      <td>3</td>\n",
       "      <td>133</td>\n",
       "      <td>27.0</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>08/05</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6643</th>\n",
       "      <td>773</td>\n",
       "      <td>3</td>\n",
       "      <td>133</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>08/06</td>\n",
       "      <td>新疆</td>\n",
       "      <td>中国</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6644 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      累计确诊  累计死亡  累计治愈  新增确诊  新增治愈  新增死亡     日期  省份  国家\n",
       "0      102     1     4  11.0     0     0  01/28  北京  中国\n",
       "1      111     1     4   9.0     0     0  01/29  北京  中国\n",
       "2      132     1     5  21.0     1     0  01/30  北京  中国\n",
       "3      156     1     5  24.0     0     0  01/31  北京  中国\n",
       "4      183     1     9  27.0     4     0  02/01  北京  中国\n",
       "...    ...   ...   ...   ...   ...   ...    ...  ..  ..\n",
       "6639   696     3   103  28.0     7     0  08/02  新疆  中国\n",
       "6640   724     3   115  28.0    12     0  08/03  新疆  中国\n",
       "6641   746     3   125  22.0    10     0  08/04  新疆  中国\n",
       "6642   773     3   133  27.0     8     0  08/05  新疆  中国\n",
       "6643   773     3   133  27.0     0     0  08/06  新疆  中国\n",
       "\n",
       "[6644 rows x 9 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#n = \"./china_province_daily_data.csv\"\n",
    "#pd.read_csv(n, encoding='gbk')\n",
    "data = pd.read_csv('./china_province_daily_data.csv', encoding='gbk')\n",
    "data\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['日期'] = pd.to_datetime('2020/'+data['日期'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "##每天全国疫情分布图（累积确诊）\n",
    "def mapcountChina_ljqz(dateId):\n",
    "    num = data.loc[data['日期'] == dateId,:]\n",
    "    list_data = [(i,int(j)) for i,j in zip(list(num['省份']), list(num['累计确诊']))]\n",
    "    c = (\n",
    "        Map(init_opts=opts.InitOpts(width='1300px',height='800px'))\n",
    "        .add('', list_data, 'china')\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title='全国疫情分布图（累计确诊）' + str(dateId)[:10]),\n",
    "            tooltip_opts=opts.TooltipOpts(formatter='{b}: {c}'),\n",
    "            visualmap_opts=opts.VisualMapOpts(is_show=True,\n",
    "                                              split_number=6,\n",
    "                                              is_piecewise=True,  # 是否为分段型\n",
    "                                              pos_top='center',\n",
    "                                              pieces=[\n",
    "                                                  \n",
    "                                                  {'min': 3000, 'color': '#7f1818'},  # 不指定 max\n",
    "                                                  {'min': 1000, 'max': 2999},\n",
    "                                                  {'min': 500, 'max': 999},\n",
    "                                                  {'min': 100, 'max': 499},\n",
    "                                                  {'min': 10, 'max': 99},\n",
    "                                                  {'min': 0, 'max': 9}],\n",
    "                                                ),\n",
    "            )\n",
    "    )\n",
    "    return c\n",
    "for i in data['日期'][:193]:\n",
    "    mapcountChina_ljqz(i).render(\"./全国每天累计确诊地理分布图/全国{}累计确诊分布图.html\".format(str(i)[:10]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "#每天全国疫情分布图（累积死亡）\n",
    "def mapcountChina_dead(dateId):\n",
    "    num = data.loc[data['日期'] == dateId, :]\n",
    "    list_data = [(i,int(j)) for i,j in zip(list(num['省份']), list(num['累计死亡']))]\n",
    "    c = (\n",
    "        Map(init_opts=opts.InitOpts(width='1300px',height='800px'))\n",
    "        .add('', list_data, 'china')\n",
    "        .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title='全国疫情分布图（累计死亡）' + str(dateId)[:10]),\n",
    "        tooltip_opts=opts.TooltipOpts(formatter='{b}: {c}'),\n",
    "        visualmap_opts=opts.VisualMapOpts(is_show=True,\n",
    "                                          split_number=6,\n",
    "                                          is_piecewise=True,  # 是否为分段型\n",
    "                                          pos_top='center',\n",
    "                                          pieces=[\n",
    "                                              {'min': 300, 'color': '#7f1818'},  # 不指定 max\n",
    "                                              {'min': 200, 'max': 299},\n",
    "                                              {'min': 100, 'max': 199},\n",
    "                                              {'min': 50, 'max': 99},\n",
    "                                              {'min': 10, 'max': 49},\n",
    "                                              {'min': 0, 'max': 9}],\n",
    "                                            ),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "for i in data['日期'][:193]:\n",
    "    mapcountChina_dead(i).render(\"./全国每天累计死亡地理分布图/全国{}累计死亡分布图.html\".format(str(i)[:10]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "##每天全国疫情分布图（累积治愈）\n",
    "\n",
    "def mapcountChina_heal(dateId):\n",
    "    num = data.loc[data['日期'] == dateId, :]\n",
    "    list_data =[(i,int(j)) for i,j in zip(list(num['省份']), list(num['累计治愈']))]\n",
    "    c = (\n",
    "        Map(init_opts=opts.InitOpts(width='1300px',height='800px'))\n",
    "        .add('', list_data, 'china')\n",
    "        .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title='全国疫情分布图（累计治愈）' + str(dateId)),\n",
    "        tooltip_opts=opts.TooltipOpts(formatter='{b}: {c}'),\n",
    "        visualmap_opts=opts.VisualMapOpts(is_show=True,\n",
    "                                          split_number=6,\n",
    "                                          is_piecewise=True,  # 是否为分段型\n",
    "                                          pos_top='center',\n",
    "                                          pieces=[\n",
    "                                              {'min': 3000, 'color': '#7f1818'},  # 不指定 max\n",
    "                                              {'min': 1000, 'max': 2999},\n",
    "                                              {'min': 500, 'max': 999},\n",
    "                                              {'min': 100, 'max': 499},\n",
    "                                              {'min': 10, 'max': 99},\n",
    "                                              {'min': 0, 'max': 9}],\n",
    "                                          ),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "for i in data['日期'][:193]:\n",
    "    mapcountChina_heal(i).render(\"./全国每天累计治愈地理分布图/全国{}累计治愈分布图.html\".format(str(i)[:10]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "##每天全国疫情分布图（新增确诊）\n",
    "\n",
    "def mapcountChina_newC(dateId):\n",
    "    num = data.loc[data['日期'] == dateId, :]\n",
    "    list_data =[(i,j) for i,j in zip(list(num['省份']), list(num['新增确诊']))]\n",
    "    c = (\n",
    "        Map(init_opts=opts.InitOpts(width='1300px',height='800px'))\n",
    "        .add('', list_data, 'china')\n",
    "        .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title='全国疫情分布图（新增确诊）' + str(dateId)),\n",
    "        tooltip_opts=opts.TooltipOpts(formatter='{b}: {c}'),\n",
    "        visualmap_opts=opts.VisualMapOpts(is_show=True,\n",
    "                                          split_number=6,\n",
    "                                          is_piecewise=True,  # 是否为分段型\n",
    "                                          pos_top='center',\n",
    "                                          pieces=[\n",
    "                                              {'min': 300, 'color': '#7f1818'},  # 不指定 max\n",
    "                                              {'min': 200, 'max': 299},\n",
    "                                              {'min': 100, 'max': 199},\n",
    "                                              {'min': 50, 'max': 99},\n",
    "                                              {'min': 10, 'max': 49},\n",
    "                                              {'min': 0, 'max': 9}],\n",
    "                                          ),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "for i in data['日期'][:193]:\n",
    "    mapcountChina_newC(i).render(\"./全国每天新增确诊地理分布图/全国{}新增确诊分布图.html\".format(str(i)[:10]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "###在1.20日左右，全国公布的疫情一开始出现在广东、湖北、北京上海等地，此时湖北的疫情确诊人数已经突破200；\n",
    "###此后，疫情从湖北开始向四周身份成扩散趋势，在1.26日湖北的确诊人数已经突破1000；除湖北外，浙江与广东确诊人数也到达三位数；\n",
    "##在2.2日前后，湖北的确诊人数突破五位数，其他地区疫情人数继续增加；\n",
    "##在2月中旬，西藏成为国内首个清零的省份国内疫情迎来拐点，现存确诊人数趋于平缓、不再增加，并开始缓慢减少；现存确诊人数约为50000左右，其中大部分集中在湖北；\n",
    "##二月底三月初，国内确诊人数逐渐减少，\n",
    "##三月中旬后，国内疫情已经基本得到控制，大多省份恢复到个位数或清零，绝大多数现存确诊病例集中在湖北；\n",
    "##四月初，国内确诊人数继续减少，但有部分省份出现略微反扑；\n",
    "##从四月中旬开始，由于外来输入原因，国内黑龙江及东北地区出现了一次比较严重的疫情反扑，确诊人数接近500，但在五月初逐步得到控制；"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
